<head>
  <title><%= web_title %></title>
  <meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <%= stylesheet_link_tag "user_sessions_new","webs","site_nav"%>
  <%= javascript_include_tag "user_sessions" %>
  <%= csrf_meta_tags %>

</head>
<div class="site vtop">
  <%# ******************************** site-nav ******************************** %>
  <%= render '/layouts/site_nav' %>
  <div class="follow-site">
  <a href="/">
  <img style="position:relative;top:30px;" src="/assets/logo.gif">
  </a>
  </div>
</div>

<body>
<div class="move-down fake-body">
  <div class="wks clearfix">
    <div class="left inline-block vtop">&nbsp;</div>
    <div class="right-outer inline-block">
    <div class="shadow-5 inline-block"></div>
    <div class="right inline-block vtop">
      <% if current_user.nil? %>
          <%= form_for @user_session, :url => user_session_path do |form| %>
              <div class="title vmiddle">
                <%= t 'activerecord.attributes.session.vmiddle' %>
              </div>
              <div id="notice"><%= notice %></div>
              <input type="hidden" name="m" value="login"/>
              <a class="form-close-btn inline-block" id="loginCloseBtn"></a>

              <div class="login-form">
                <div class="form-row">
                  <label>帐号</label>
                  <%= form.text_field :login%>
                </div>
                <div class="form-row">
                  <label><%= t 'activerecord.attributes.session.password' %></label>
                  <%= form.password_field :password, :class => "enter_login" %>
                </div>
                <div class="form-row">

                  <%= form.check_box :remember_me, :style=>"width: 20px; margin-left: 100px;" %><span style="color: #999999;cursor: pointer;" onclick="change_auto_login(this);">一周内自动登录</span>
                  <a href="/password_reset" class="op-btn" style="margin-left: 10px;color: #999999;" tabindex="-1"><%= t 'activerecord.attributes.session.forget' %></a>
                </div>
              </div>
              <div class="form-btns">
                <a href="javascript:$('form')[0].submit()" class="inline-block s-btn-orange" style="color: #a83f00;font-size: 14px;"><%= t 'activerecord.attributes.session.login' %></a>
                <a href="/shipper_register" class="op-btn" style="margin-left: 10px;">立即注册</a>
              </div>
          <% end %>
      <% else %>
          <div class="title vmiddle">您已登录
            <a href="/" style="font-weight: normal;font-size: 12px;margin-left: 20px;">返回首页</a>
          </div>
          <div id="notice"><%= notice %></div>
          <div class="login-form" style="text-align: center;position: relative;">
            <p style="font-size: 14px;margin-top: 20px;">如果您需要切换登录用户，则请先：</p>

            <div style="margin-top: 30px;font-size: 12px;">
              <a href="/logout">退出当前用户</a>
            </div>
          </div>
      <% end %>
    </div>
    </div>
    <div class="right-part inline-block vtop"></div>
  </div>
</div>
<%# ******************************** footer ******************************** %>
<%= render '/layouts/footer' %>
</body>

<style type="text/css">
  #notice{
      display: inline-block;
      vertical-align: middle;
      text-align: center;
      color: red;
        font-size: 13px;
      width: 100%;
        margin-top: 0;
      height: 30px;
        line-height: 30px;
  }
</style>
<script type="text/javascript">
  function change_auto_login(thisObj) {
      var check = $(thisObj).prev().attr("checked");
      if (check) {
          $(thisObj).prev().removeAttr("checked");
      } else {
          $(thisObj).prev().attr("checked", true);
      }
  }
</script>